home *** CD-ROM | disk | FTP | other *** search
- property mySprite, Active, actionNum, myType, myTile, tileIconName, tileFloating, FloorPlanDisplaySprite, doubleClickDelay, startTicks, waitingToPlaceTile, clickLoc, ancestor, initted, whatPlacement, whatItem, state
-
- on beginSprite me
- mySprite = me.spriteNum
- myType = #tileSprite
- state = #off
- ancestor = new(script("TileBehave actions"), mySprite)
- end
-
- on exitFrame me
- global gIsoEngineTracker, gIso
- if not initted then
- init(me)
- initted = 1
- end if
- if waitingToPlaceTile then
- if the ticks > (startTicks + doubleClickDelay) then
- result = addFPitem(gIso, whatItem, clickLoc, whatPlacement)
- waitingToPlaceTile = 0
- end if
- end if
- if tileShouldGoInactive(me) then
- goInactive(me)
- else
- goActive(me)
- end if
- if not Active then
- exit
- end if
- if voidp(myTile) then
- exit
- end if
- set the loc of sprite mySprite to the mouseLoc
- end
-
- on mouseUp me
- global gIso
- clickLoc = the mouseLoc
- if not Active then
- exit
- end if
- if not tileFloating then
- exit
- end if
- tileInfoList = SIRollover(gIso, clickLoc)
- outPut("tileInfoList = " & tileInfoList)
- if the ticks < (startTicks + doubleClickDelay) then
- result = removeFPitem(gIso, whatItem, clickLoc, whatPlacement)
- startTicks = 0
- waitingToPlaceTile = 0
- exit
- end if
- startTicks = the ticks
- waitingToPlaceTile = 1
- end
-
- on setTile me, aTileIconName
- global gIsoEngineTracker
- tileIconName = aTileIconName
- actionNum = integer(word 3 of tileIconName)
- whatItem = word 2 of tileIconName
- case whatItem of
- "InteriorWalls":
- myTile = "IntWalltile" && actionNum
- whatPlacement = [#nw, #ne, #se, #sw, #n, #e, #s, #w][actionNum]
- if actionNum < 5 then
- whatItem = #interiorwall
- else
- whatItem = #interiorcorner
- end if
- end case
- set the member of sprite mySprite to member(myTile)
- setTileFloating(gIsoEngineTracker, 1)
- tileFloating = 1
- end
-
- on killTile me
- global gIsoEngineTracker
- setTileFloating(gIsoEngineTracker, 0)
- goInactive(me)
- actionNum = VOID
- myTile = VOID
- tileFloating = 0
- end
-
- on showProps me
- PropNum = count(me)
- repeat with x = 1 to PropNum
- prop = 0
- thisProp = getPropAt(me, x)
- if thisProp = #myHandlers then
- next repeat
- end if
- prop = string(getPropAt(me, x)) && "=" && getaProp(me, thisProp)
- put prop
- end repeat
- end
-